<!DOCTYPE html>
<html>
   <head>
      <title>Redirect</title>
      <script>
         window.onload = function() {
            const isWechat = navigator.userAgent.includes('MicroMessenger')
            const messageEl = document.getElementById('message')
            const params = new URL(window.location.href).searchParams
            const app = params.get('app')
            const url = app ? `https://${app}.vercel.app` : params.get('url')
            if (!app || !url) {
               messageEl.innerText = '链接不对，跳转失败'
               return
            }
            if (isWechat) {
               messageEl.innerText = `请点击右上角用浏览器打开 ${app || url}`
            } else {
               location.href = url
            }
         }
      </script>
      <style>
         #message {
            text-align: center;
            margin-top: 10%;
         }
      </style>
   </head>
   <body>
      <p id="message">稍等...</p>
   </body>
</html>
